﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

namespace ImaginaryDevelopmentMvc3.App
{
    /// <summary>
    /// Items are settable for testability/experimentation
    /// </summary>
    public class Configuration
    {
        private static Configuration _instance = new Configuration();
        private Configuration()
        {
        }

        private static string _WindowsLiveClientID;
        private static string _WindowsLiveClientSecret;
        private static string _facebookAppID;

        /// <summary>
        /// For unmapped items should not use
        /// </summary>
        /// <returns></returns>
        public static Configuration AppSettings()
        {
            return _instance;
        }
        public  string this[string name]
        {
            get
            {
                return ConfigurationManager.AppSettings[name];
            }
            set
            {
                ConfigurationManager.AppSettings[name] = value;
            }
        }

        private static string _facebookAppId;
        public static string FacebookAppID
        {
            get { return _facebookAppId ?? ConfigurationManager.AppSettings["facebookAppID"]; }
            set { _facebookAppId = value; }
        }

        

        private static string _twitterConsumerKey;
        public static string TwitterConsumerKey
        {
            get { return _twitterConsumerKey ?? ConfigurationManager.AppSettings["twitterConsumerKey"]; }
            set { _twitterConsumerKey = value; }
        }

        public static string WindowsLiveClientId
        {
            get { return _WindowsLiveClientID ?? ConfigurationManager.AppSettings["WindowsLiveClientID"]; }
            set { _WindowsLiveClientID = value; }
        }

        public static string WindowsLiveClientSecret
        {
            get { return _WindowsLiveClientSecret ?? ConfigurationManager.AppSettings["WindowsLiveClientSecret"]; }
            set { _WindowsLiveClientSecret = value; }
        }
    }
}